#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main() {
    int seconds, h, m, s;
    scanf("%d", &seconds);
    h = seconds / 3600;
    m = (seconds % 3600) / 60;
    s = (seconds % 3600) % 60;
    printf("%d %d %d", h, m, s);
}